export const moduleA = {
    namespaced: true,
    state: {
        count: 0,
    },
    mutations: {
        //数量加减
        changeCount(state: any, payload: any) {
            state.count = state.count + payload
        },
    },
    getters:{
        // 数量的双倍
        doubleCount(state:any){
            return state.count*2
        }
    },
    actions: {
        // 异步数量加减
        async changeCountAsync(content:any, preload:any) {
            setTimeout(()=>{
                content.commit('changeCount',preload)
            },1000)
        }
    }
};
